package com.fc.test.shiro.config;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @ClassName: ShiroFilterMapFactory
 *
 */
public class ShiroFilterMapFactory {
	

	
	public static Map<String, String> shiroFilterMap() {
//		设置路径映射，注意这里要用LinkedHashMap 保证有序
		LinkedHashMap<String, String> filterChainDefinitionMap = new LinkedHashMap<>();
		//对所有用户认证
		filterChainDefinitionMap.put("/static/**", "anon");
		// 放开注册登陆退出
		filterChainDefinitionMap.put("/admin/login", "anon");
		filterChainDefinitionMap.put("/admin/register", "anon");
		filterChainDefinitionMap.put("/admin/zhuce1", "anon");
		filterChainDefinitionMap.put("/admin/logout", "logout");
		//放验证码
		filterChainDefinitionMap.put("/captcha/**", "anon");
		// 释放 druid 监控画面
		filterChainDefinitionMap.put("/druid/**", "anon");
		//释放websocket请求
		filterChainDefinitionMap.put("/websocket", "anon");
		//前端
		filterChainDefinitionMap.put("/", "anon");
		filterChainDefinitionMap.put("/register", "anon");
		filterChainDefinitionMap.put("/index", "anon");
		
		filterChainDefinitionMap.put("/quartz/**", "anon");
		
		//开放APicontroller
		filterChainDefinitionMap.put("/ApiController/**", "anon");
		
		//对所有页面进行认证
		filterChainDefinitionMap.put("/**","authc");
		return filterChainDefinitionMap;
	}
}
